// import Mock from 'mockjs'
import { SUCCESS_CODE } from "../../constants"
import { generateRoleRouter } from "./utils"

// const menu = getMenu(2, AsyncRouter)
// console.log(menu);

// 获取菜单列表
const getRoleRoutes = {
  method: "get",
  url: "/role-routes",
  cb: (req: any) => {
    const { userId } = req.body
    return {
      code: SUCCESS_CODE,
      data: {
        roleRoutes: generateRoleRouter(userId),
        // routes: AsyncRouter,
      },
      msg: "获取菜单列表成功",
      success: true
    }
  }
}

export const roleMock = [
  getRoleRoutes
]

